home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
A-Monthly Disks
/
(c)abh.d64
/
credit-card-ctrl
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
8KB
|
310 lines
100 REM CREDIT CARD CTRL
110 REM G. ROGER GATHERS 12/1/88
120 POKE 53280,0:POKE 53281,0:POKE 646,13
130 PRINT CHR$(147):FOR T=1 TO 10:PRINT:NEXT T
140 PRINT TAB(10)"CREDIT CARD CONTROL"
150 PRINT TAB(10)"-------------------"
160 FOR T= 1 TO 1000:NEXT T
170 N=100:DIM D$(N),B$(N),E$(N),F$(N),L$(N),P$(N)
180 PRINT CHR$(147)
190 FOR I = 1 TO 6:PRINT:NEXT I
200 POKE 646,7
210 PRINT TAB(14)"***MENU***":PRINT
220 POKE 646,3
230 PRINT TAB(6)"1 - DISPLAY CREDIT CARD LIST"
240 PRINT TAB(6)"2 - CREATE/ADD CREDIT CARD DATA"
250 PRINT TAB(6)"3 - REPORT LOST OR DAMAGED CARDS"
260 PRINT TAB(6)"4 - DELETE CARDS"
270 PRINT TAB(6)"5 - LIST FILE ON PRINTER"
280 PRINT TAB(6)"6 - DISPLAY FULL DETAIL ON CARDS"
285 PRINT TAB(6)"7 - EDIT FILES"
290 PRINT TAB(6)"8 - EXIT PROGRAM"
300 POKE 646,7
310 PRINT:PRINT TAB(12)"ENTER SELECTION[146]"
315 PRINT:PRINT
320 GET A$:IF A$="" THEN 320
330 IF VAL(A$)>8 THEN PRINT TAB(13)"1-8 0NLY":FOR T=1 TO 900:NEXT T:GOTO 180
350 ON VAL(A$) GOTO 1000,2000,3000,4000,5000,6000,7000,360
360 END
1000 REM DISPLAY CREDIT CARD LIST
1010 GOSUB 8000:REM READ FILE
1020 PRINT CHR$(147):PRINT
1030 POKE 646,7
1040 PRINT "CREDIT CARDS ON FILE:":PRINT
1050 POKE 646,13
1060 PRINT "NAME[146]"TAB(13)"ACCT. #[146]"TAB(30)"EXP. DATE[146]"
1070 PRINT"-----"TAB(13)"-------"TAB(30)"---------"
1080 K1=0:POKE 646,3
1090 FOR I = 1 TO N
1110 IF D$(I)="END" THEN 1200
1120 IF K1<15 THEN 1170
1125 POKE 646,7
1130 PRINT:PRINT TAB(8)"PRESS RETURN[146] TO CONTINUE":POKE 646,3:PRINT
1140 GET A$:IF A$="" THEN 1140
1150 IF A$<>CHR$(13) THEN 1140
1160 K1=0
1170 PRINT D$(I);TAB(13);B$(I);TAB(34);E$(I)
1180 K1=K1+1
1190 NEXT I
1200 PRINT:POKE 646,13:PRINT "END OF FILE":PRINT
1210 POKE 646,7
1220 PRINT TAB(12)"PRESS M FOR MENU"
1230 GET A$:IF A$="" THEN 1230
1240 IF A$<>"M" THEN 1230
1250 GOTO 180:REM RETURN TO MENU
2000 REM CREATE/ADD CREDIT DARD DATA
2010 L=1:PRINT CHR$(147):FOR I=1 TO 10:PRINT:NEXT I
2020 POKE 646,7
2030 PRINT:PRINT"A[146]DD TO EXISTING FILE"
2040 PRINT"R[146]EW FILE":PRINT"R[146]ETURN TO MENU"
2050 GET A$:IF A$="" THEN 2050
2060 IF A$="N" THEN 2120
2070 IF A$="A" THEN 2110
2080 IF A$="R" THEN 180
2090 POKE 646,5
2100 PRINT "ANSWER A, N, OR R":POKE 646,7:GOTO 2060
2110 GOSUB 8000:L=I:REM READ FILE & SET POINTER FOR NEXT ENTRY
2120 OPEN 2,0:PRINT CHR$(147)
2130 PRINT" USE END TO FINISH DATA ENTRY [146]":PRINT
2140 FOR K=L TO N
2150 PRINT "ENTRY # ";K:PRINT
2160 PRINT"CARD NAME: ";:POKE 646,3:INPUT#2,D$(K):POKE 646,7:PRINT
2170 IF D$(K)="END" THEN 2300
2180 PRINT:PRINT"ACCT, #: ";:POKE 646,3:INPUT#2,B$(K):POKE 646,7:PRINT
2190 PRINT:PRINT"EXP. DATE: ";:POKE 646,3:INPUT#2,E$(K):POKE 646,7:PRINT
2200 PRINT:PRINT"COMPANY P.O. OF STREET ADDRESS: ";:POKE 646,3
2210 INPUT#2,F$(K):POKE 646,7:PRINT
2220 PRINT:PRINT"CITY, STATE & ZIP (DO NOT USE COMMA):";:POKE 646,3
2230 INPUT#2,L$(K):POKE 646,7:PRINT
2240 PRINT:PRINT"PHONE NUMBER: ";:POKE 646,3
2245 INPUT#2,P$(K):POKE 646,7:PRINT
2250 PRINT:PRINT"IS DATA CORRECT(Y/N)?"
2260 GOSUB 12000:ON VAL(A$) GOTO 2270,2280
2270 PRINT:PRINT:GOTO 2290
2280 (null) TO 2150
2290 NEXT K
2300 CLOSE 2
2310 NC=K-1
2320 GOSUB 9000:REM WRITE THE FILE
2330 PRINT CHR$(147):PRINT"DO YOU WANT A BACKUP COPY (Y/N)?"
2340 GOSUB 12000:ON VAL(A$) GOTO 2320,2350
2350 GOTO 180:REM RETURN TO MENU
3000 REM REPORT LOST OF DAMAGED CARDS
3010 PRINT CHR$(147):OPEN 2,0:PRINT
3020 PRINT "YOUR NAME:[146]";:POKE 646,3:INPUT#2,YN$:POKE 646,7
3025 PRINT:PRINT
3030 PRINT "STREET OR POST OFFICE:[146]";:POKE 646,3:INPUT#2,MA$:POKE 646,7
3035 PRINT:PRINT
3040 PRINT "CITY:[146]";:POKE 646,3:INPUT#2,CI$:POKE 646,7
3045 PRINT:PRINT
3050 PRINT "STATE & ZIP CODE:[146]";:POKE 646,3:INPUT#2,SZ$:POKE 646,7
3055 PRINT:PRINT
3060 PRINT "TODAY'S DATE (EX DEC 7 1988):[146]";:POKE 646,3:INPUT#2,TD$:POKE 646,7
3065 PRINT:PRINT
3070 CLOSE 2
3080 GOSUB 8000: REM READ FILE
3090 FOR I=1 TO N
3100 POKE 646,7:IF D$(I)="END" THEN 3210
3110 PRINT:PRINT "DO YOU WANT A REPORT FOR:";:POKE 646,3:PRINT,D$(I)
3120 POKE 646,7:GOSUB 12000:ON VAL(A$) GOTO 3130,3200
3130 PRINT:POKE 646,7:PRINT "DO YOU WANT THE REPORTING PHONE NUMBER?"
3140 GOSUB 12000:ON VAL(A$) GOTO 3150,3160
3150 POKE 646,3:PRINT P$(I):POKE 646,7
3160 PRINT:PRINT "DO YOU WANT TO MAKE A WRITTEN REPORT?"
3170 GOSUB 12000:ON VAL(A$) GOTO 3180,3200
3180 PRINT:PRINT "IS CARD LOST OR DESTROYED";:POKE 646,3:INPUT W$:PRINT:PRINT
3190 GOSUB 10000:REM PRINT THE LETTER
3200 NEXT I
3210 PRINT "END OF FILE"
3220 (null) TO 180: REM RETURN TO MENU
4000 REM DELETE CARDS
4010 GOSUB 8000:REM READ FILE
4020 I=1:POKE 646,3
4030 PRINT:PRINT D$(I);TAB(10);B$(I):POKE 646,7
4040 PRINT:PRINT TAB(8)"DELETE THIS CARD?":POKE 646,3
4050 GOSUB 12000:ON VAL(A$) GOTO 4060,4110
4060 FOR J=I+1 TO NC+1
4070 D$(J-1)=D$(J):B$(J-1)=B$(J):E$(J-1)=E$(J)
4080 F$(J-1)=F$(J):L$(J-1)=L$(J):P$(J-1)=P$(J)
4090 NEXT J
4100 NC=NC-1:I=I-1
4110 I=I+1:IF I>NC THEN 4130
4120 (null) TO 4030
4130 POKE 646,7:GOSUB 9000:REM WRITE NEW FILE
4140 GOTO 180:REM RETURN TO MENU
5000 REM LIST FILE ON PRINTER
5010 GOSUB 8000:OPEN 4,4:REM READ FILE & OPEN PRINTER
5020 PRINT#4,"CREDIT CARDS ON FILE TO DATE":PRINT#4
5025 PRINT#4,"FILE NAME: ";FI$:PRINT#4
5030 FOR I=1 TO NC
5040 IF D$(I)="END" THEN 5130
5050 PRINT#4,"NAME: ",D$(I)
5060 PRINT#4,"ACCT. #: ",B$(I)
5070 PRINT#4,"EXP. DATE: ", E$(I)
5080 PRINT#4,"COMPANY ADDRESS"
5090 PRINT#4,F$(I)
5100 PRINT#4,L$(I)
5110 PRINT#4,"REPORTING PHONE # ",P$(I):PRINT#4
5120 NEXT I
5130 PRINT#4,"END OF FILE":PRINT#4,CHR$(12)
5140 CLOSE 4
5150 PRINT:PRINT ," PRESS M FOR MENU "
5160 GET A$:IF A$="" THEN 5160
5170 IF A$<>"M" THEN 5160
5180 (null) TO 180:REM RETURN TO MENU
6000 REM SHOW FULL DETAILS OF EACH CARD
6010 GOSUB 8000:REM READ FILES
6020 PRINT CHR$(147):PRINT
6030 PRINT "CREDIT CARDS ON FILE (FULL DETAILS):":PRINT
6040 FOR I=1 TO N
6050 POKE 646,3
6060 IF D$(I)="END" THEN 6170
6070 POKE 646,13:PRINT "NAME: ";:POKE 646,3:PRINT,D$(I):PRINT
6080 POKE 646,13:PRINT "ACCT. #: ";:POKE 646,3:PRINT,B$(I):PRINT
6090 POKE 646,13:PRINT "EXP. DATE: ";:POKE 646,3:PRINT,E$(I):PRINT
6100 POKE 646,13:PRINT "COMPANY ADDR: ";:POKE 646,3:PRINT,F$(I):PRINT
6110 POKE 646,13:PRINT "CITY, STATE & ZIP: ";:POKE 646,3:PRINT,L$(I):PRINT
6115 POKE 646,13
6120 PRINT "REPORTING PHONE #: ";:POKE 646,3:PRINT,P$(I):PRINT:POKE 646,7
6130 PRINT:PRINT TAB(8)"PRESS RETURN[146] TO CONTINUE":PRINT
6140 GET A$:IF A$="" THEN 6140
6150 IF A$<>CHR$(13) THEN 6140
6160 NEXT I
6170 PRINT:POKE 646,13:PRINT "END OF FILE":PRINT
6180 POKE 646,7
6190 PRINT TAB(12)"PRESS M FOR MENU"
6200 GET A$:IF A$="" THEN 6200
6210 IF A$<>"M" THEN 6200
6220 (null) TO 180:REM RETURN TO MENU
7000 REM EDIT FILES
7010 GOSUB 8000:REM READ FILE
7020 PRINT CHR$(147):PRINT:POKE 646,7
7025 PRINT,"CARD NAME TO EDIT: ";:POKE 646,3:INPUT CN$:POKE 646,7:PRINT
7030 PRINT," TYPE EITHER NEW INFORMATION "
7035 PRINT," OR RETURN FOR EACH ITEM ":PRINT
7040 FOR I=1 TO N
7050 POKE 646,13
7060 IF D$(I)="END" THEN 7290
7065 IF D$(I)<>CN$ THEN 7280
7070 PRINT,"NAME: ";:POKE 646,3:PRINT,D$(I);:INPUT NE$
7080 IF NE$<>"" THEN D$(I)=NE$
7090 POKE 646,13:PRINT:NE$=""
7100 PRINT,"ACCT, #: ";:POKE 646,3:PRINT,B$(I);:INPUT NE$
7110 IF NE$<>"" THEN B$(I)=NE$
7120 POKE 646,13:PRINT:NE$=""
7130 PRINT,"EXP. DATE: ";:POKE 646,3:PRINT,E$(I);:INPUT NE$
7140 IF NE$<>"" THEN E$(I)=NE$
7150 POKE 646,13:PRINT:NE$=""
7160 PRINT,"COMPANY ADDR: ";:POKE 646,3:PRINT,F$(I);:INPUT NE$
7170 IF NE$<>"" THEN F$(I)=NE$
7180 POKE 646,13:PRINT:NE$=""
7190 PRINT,"CITY, STATE & ZIP: ";:POKE 646,3:PRINT,L$(I);:INPUT NE$
7200 IF NE$<>"" THEN L$(I)=NE$
7210 POKE 646,13:PRINT:NE$=""
7220 PRINT,"REPORTING PHONE #: ";:POKE646,3:PRINT,P$(I);:INPUT NE$
7230 IF NE$<>"" THEN P$(I)=NE$
7240 POKE 646,7:PRINT:NE$=""
7250 PRINT TAB(8)"PRESSRETURN[146] TO CONTINUE":PRINT
7260 GET A$:IF A$="" THEN 7260
7270 IF A$<>CHR$(13) THEN 7260
7280 NEXT I
7290 PRINT:POKE 646,13:PRINT,"END OF FILE":PRINT
7295 FOR T=1 TO 1000:NEXT T
7300 POKE 646,7
7310 NC=I-1
7320 GOSUB 9000:REM WRITE THE FILE
7330 PRINT CHR$(147):PRINT,"DO YOU WANT A BACKUP COPY (Y/N)?"
7340 GOSUB 12000:ON VAL(A$) GOTO 7320,7350
7350 (null) TO 180:REM RETURN TO MENU
8000 REM READ FILE SUBROUTINE
8010 PRINT CHR$(147):PRINT:PRINT
8020 INPUT "INPUT FILE NAME[146]";FI$:PRINT
8030 PRINT " INSERT SOURCE FILE AND PRESS RETURN [146]"
8040 GET A$:IF A$="" THEN 8040
8050 IF A$<>CHR$(13) THEN 8040
8060 PRINT:PRINT "T[146]APE OF D[146]ISK":PRINT
8070 GET A$:IF A$="" THEN 8070
8080 IF A$="T" THEN OPEN 1,1,0,FI$:DR$="T":GOTO 8120
8090 IF A$="D" THEN OPEN1,8,8,FI$+",S,R":DR$="D":GOTO 8120
8100 POKE 646,5
8110 PRINT "ANSWER T OR D":POKE 646,7:GOTO 8070
8120 PRINT CHR$(147):PRINT
8130 POKE 646,13
8140 PRINT "READING FILE"
8150 POKE 646,7
8160 FOR I=1 TO N
8170 INPUT#1,D$(I)
8180 IF D$(I)="END" THEN 8210
8190 INPUT#1,B$(I),E$(I),F$(I),L$(I),P$(I)
8200 NEXT I
8210 CLOSE 1:NC=I-1
8220 IF DR$="T" THEN 8240
8230 GOSUB 11000
8240 RETURN
9000 REM WRITE FILE SUBROUTINE
9010 PRINT CHR$(147):PRINT
9020 INPUT "OUTPUT FILE NAME[146]";FI$:PRINT
9030 PRINT " INSERT FILE AND PRESS RETURN[146]"
9040 GET A$:IFA$="" THEN 9040
9050 IF A$<>CHR$(13) THEN 9040
9060 PRINT:PRINT "T[146]APE OF D[146]ISK":PRINT
9070 GET A$:IF A$="" THEN 9070
9080 IF A$="T" THEN OPEN 3,1,0,FI$:DR$="T":GOTO 9120
9090 IF A$="D" THEN OPEN 3,8,8,"@0:"+FI$+",S,W":DR$="D":GOTO 9120
9100 POKE 646,5
9110 PRINT "ANSWER T OR D":POKE 646,7:GOTO 9070
9120 PRINT CHR$(147):POKE 646,13:PRINT "WRITING OUTPUT FILE"
9130 POKE 646,7
9140 FOR I=1 TO NC
9150 PRINT#3,D$(I):PRINT#3,B$(I):PRINT#3,E$(I)
9160 PRINT#3,F$(I):PRINT#3,L$(I):PRINT#3,P$(I)
9170 NEXT I
9180 D$(NC+1)="END":PRINT#3,D$(NC+1)
9190 CLOSE 3
9200 IF DR$="T" THEN 9220
9210 GOSUB 11000
9220 RETURN
10000 REM LETTER PRINTING SUBROUTINE
10010 OPEN 4,4
10020 PRINT#4:SN$="SINCERELY"
10030 PRINT#4,TAB(50);MA$
10035 T2=60-LEN(CI$):T3=10-LEN(SZ$)
10040 PRINT#4,TAB(T2);CI$;TAB(T3);SZ$
10050 PRINT#4,TAB(50);TD$
10060 PRINT#4, D$(I)
10070 PRINT#4, F$(I)
10080 PRINT#4, L$(I)
10090 PRINT#4
10100 PRINT#4,"RE: ACCOUNT # ";B$(I):PRINT#4
10110 PRINT#4,"DEAR SIR:":PRINT#4
10120 PRINT#4,TAB(5)"IN REGARD TO THE ABOVE ACCOUNT,";
10130 PRINT#4," I AM REPORTING THAT MY CARD WAS":PRINT#4
10140 PRINT#4, W$;" ON OR ABOUT THE ABOVE DATE.":PRINT#4
10150 PRINT#4,TAB(5)"PLEASE TAKE ANY NECESSARY ACTION";
10160 PRINT#4," TO INSURE THAT THERE IS NO":PRINT#4
10170 PRINT#4,"UNAUTHORIZED USE OF THIS CARD,";
10180 PRINT#4," AND PLEASE ISSUE A REPLACEMENT AS":PRINT#4
10190 PRINT#4,"SOON AS POSSIBLE.":PRINT#4
10200 PRINT#4,TAB(5)"PLEASE CONTACT ME IF";
10210 PRINT#4," ADDITIONAL INFORMATION IS NEEDED."
10220 FOR K=1 TO 4:PRINT#4:NEXT K
10230 PRINT#4,TAB(50);SN$
10240 FOR K=1 TO 4:PRINT#4:NEXT K
10250 PRINT#4,TAB(50);YN$
10260 PRINT#4,CHR$(12):CLOSE 4
10270 RETURN
11000 REM CHECK DISK SUBROUTINE
11010 OPEN 15,8,15
11020 INPUT#15,EN,EM$,ET,ES
11030 IF EN>1 AND EN<>50 THEN PRINT EN,EM$,ET,ES:STOP
11040 CLOSE 15
11050 RETURN
12000 REM YES/NO SUBROUTINE
12010 GET A$:IF A$="" THEN 12010
12020 IF A$="Y" THEN 12060
12030 IF A$="N" THEN 12070
12040 POKE 646,5
12050 PRINT:PRINT"ANSWER Y OR N":POKE 646,3:GOTO 12010
12060 A$="1":RETURN
12070 A$="2":RETURN